package com.cortex.pineapple.view;


import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

public class CortexScrollView extends ScrollView {
	
	private OnScrollChangedListener onScrollChangedListener;
	
	public CortexScrollView(Context context) {
		super(context);
	}
	public CortexScrollView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	public CortexScrollView(Context context, AttributeSet attrs,int style) {
		super(context, attrs,style);
		init();
	}
	private void init(){
		initListeners();

	}
	private void initListeners(){
		
	}
	
	public void setOnScrollChangedListener(
			OnScrollChangedListener onScrollChangedListener) {
		this.onScrollChangedListener = onScrollChangedListener;
	}
	@Override
	protected void onScrollChanged(int l, int t, int oldl, int oldt) {
		// TODO Auto-generated method stub
		super.onScrollChanged(l, t, oldl, oldt);
		if(onScrollChangedListener != null){
			onScrollChangedListener.scrollChanged(l, t, oldl, oldt);
		}
		
	}
	
	
	public interface OnScrollChangedListener{
		void scrollChanged(int l, int t, int oldl, int oldt);
	}
	
	
}
